"use client"
import React from 'react'
import RcRate from 'rc-rate';
import type { RateRef, RateProps as RcRateProps } from 'rc-rate/lib/Rate';
import 'rc-rate/assets/index.css';
import { IoMdStar } from 'react-icons/io';
import classNames from 'classnames';

const MyRate = React.forwardRef<RateRef, RcRateProps & { [key: string]: any }>((props, ref) => {
  const { className, style, character = <IoMdStar />, disabled = false, ...rest } = props;
  const mergedStyle: React.CSSProperties = { ...style };

  return (
    <RcRate
      ref={ref}
      character={character}
      disabled={disabled}
      {...rest}
      className={classNames(className)}
      style={mergedStyle}
    />
  );
});

export default MyRate;